﻿<Button x:Class="CardPlay.Client.Controls.CommandLink"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Controls="clr-namespace:CardPlay.Client.Controls" mc:Ignorable="d" HorizontalContentAlignment="Stretch"
    MinWidth="200">
    <Border CornerRadius="2" BorderBrush="White" BorderThickness="1">
        <Grid Margin="1" >
            <Grid.Resources>
                <BitmapImage x:Key="arrow" UriSource="../Assets/command_link_normal.png" />
                <Style TargetType="TextBlock">
                    <Setter Property="Foreground" Value="#FF003399"/>
                    <Setter Property="FontFamily" Value="Segoe UI"/>
                    <Setter Property="VerticalAlignment" Value="Top"/>
                    <Setter Property="HorizontalAlignment" Value="Stretch"/>
                    <Style.Triggers>
                        <Trigger Property="Text" Value="{x:Null}">
                            <Setter Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="Text" Value="">
                            <Setter Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Image Source="{StaticResource arrow}" Grid.RowSpan="2" Width="16" VerticalAlignment="Top" Margin="4,4,4,0" />
            <TextBlock Grid.Column="1" FontSize="16" Text="{Binding RelativeSource={RelativeSource AncestorType=Controls:CommandLink}, Path=Instruction, Mode=OneWay}" />
            <TextBlock Grid.Column="1" Grid.Row="2" Margin="0,4,0,0" TextWrapping="Wrap" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType=Controls:CommandLink}, Path=Description, Mode=OneWay}" />
        </Grid>
    </Border>
</Button>
